<?php

class Zend_View_Helper_ImageSize {

    public function imageSize($image, $width, $height) {
                if(!Zend_Uri::check($image))
                    $image = "http://musicevent.local/" . $image;
                $size = getimagesize($image);
                $factor = $size[1] / $size[0];
                if($factor < 1.2 && $factor > 0.7)
                    return 'width="' . $width . '"';
                elseif ($size[0] > $size[1])
                    return 'height="' . $height . '"';
                else
                    return 'width="' . $width . '"';

    }

}
